#ifndef MYSTRING_H_
#define MYSTRING_H_

#include <stddef.h>
#include <iostream>

class mystring {
public:
    mystring();
    mystring(const char *s);
    mystring(const mystring &str);
    mystring &operator=(const mystring &str);
    ~mystring();
    void swap(mystring &str);
    const char* c_str() const;
    size_t length() const;
    char &operator[](size_t i);
    const char &operator[](size_t i) const;
    bool operator==(const mystring &str) const;
    bool operator!=(const mystring &str) const;
    friend std::istream &operator>>(std::istream &stream, mystring &str);
    friend std::ostream &operator<<(std::ostream &stream, const mystring &str);
private:
    char *m_str;
};

#endif
